﻿<Window x:Class="SmartCodeGenerator.winBatchGenerator"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:SmartCodeGenerator"
        Title="Batch Generator"    Icon="images/Logo.png"  WindowStartupLocation="CenterScreen"  Height="640" Width="600" ResizeMode="NoResize">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30"></RowDefinition>
            <RowDefinition Height="10"></RowDefinition>
            <RowDefinition Height="220"></RowDefinition> 
            <RowDefinition Height="70"></RowDefinition>
            <RowDefinition Height="230"></RowDefinition>
            <RowDefinition Height="10"></RowDefinition>
            <RowDefinition Height="30"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100"></ColumnDefinition>
                <ColumnDefinition Width="200"></ColumnDefinition>
                <ColumnDefinition Width="80"></ColumnDefinition>
                <ColumnDefinition Width="200"></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <Label  Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" FontWeight="Bold" >Server Name</Label>
            <Label Grid.Column="1" Name="lblServerName" HorizontalAlignment="Left" VerticalAlignment="Center" >Name</Label>
            <Label Grid.Column="2" HorizontalAlignment="Left" VerticalAlignment="Center"  FontWeight="Bold" >DataBase</Label>
            <ComboBox Grid.Column="3" Name="cboxDatabases" Height="25" SelectionChanged="cboxDatabase_SelectionChanged"></ComboBox>           
        </Grid>
        <Separator Grid.Row="1"></Separator>
        <Grid Grid.Row="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="200"></ColumnDefinition>
                    <ColumnDefinition Width="180"></ColumnDefinition>
                    <ColumnDefinition Width="200"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <ListBox Grid.Column="0" Name="listLeftTables" SelectionMode="Multiple" Margin="5,0,0,0"></ListBox>
            <ListBox Grid.Column="2" Name="listRightTables" SelectionMode="Multiple"></ListBox>
                <Button Grid.Column="1" Name="btnAddAll" Height="28" Width="150" Click="btnAddAll_Click" VerticalAlignment="Center"  HorizontalAlignment="Center" Margin="0,-90,0,0" >Add All</Button>
                <Button Grid.Column="1" Name="btnAddSelected" Height="28" Width="150" Click="btnAddSelected_Click" VerticalAlignment="Center"  HorizontalAlignment="Center" Margin="0,-30,0,0" >Add Selected</Button>
                <Button Grid.Column="1" Name="btnRemoveSelected" Height="28" Width="150" Click="btnRemoveSelected_Click" VerticalAlignment="Center"  HorizontalAlignment="Center" Margin="0,30,0,0" >Remove Selected</Button>
                <Button Grid.Column="1" Name="btnRemoveAll" Height="28" Width="150"  Click="btnRemoveAll_Click" VerticalAlignment="Center"  HorizontalAlignment="Center" Margin="0,90,0,0" >Remove All</Button>
            </Grid>  
        <Grid Grid.Row="3" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="120"></ColumnDefinition>
                    <ColumnDefinition Width="460"></ColumnDefinition> 
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="30"></RowDefinition>
                    <RowDefinition Height="30"></RowDefinition> 
            </Grid.RowDefinitions>
                <Label Grid.Column="0" Grid.Row="0" Name="lblNameSpace" VerticalAlignment="Center"  >NameSpace Root:</Label>
                <Label Grid.Column="0" Grid.Row="1" Name="lblLocalFolder" VerticalAlignment="Center" >Export Path:</Label>       
                <TextBox Grid.Column="1" Grid.Row="0" Name="txtNameSpaceRoot"  Height="26" VerticalAlignment="Center"></TextBox>
            <TextBox Grid.Column="1" Grid.Row="1"  Name="txtExportPath" Height="26" VerticalAlignment="Center" MouseDoubleClick="txtExportPath_MouseDoubleClick"></TextBox>
        </Grid>  
        <TreeView Grid.Row="4" Width="578" Name="tvTemplates" SelectedItemChanged="tvTemplates_SelectedItemChanged">
                <TreeView.ItemTemplate>
                    <HierarchicalDataTemplate DataType="{x:Type local:PropertyNodeItem}"  ItemsSource="{Binding Path=Children}">
                        <StackPanel Orientation="Horizontal" ToolTip="{Binding Value}">
                            <Image VerticalAlignment="Center" Source="{Binding Icon}" Width="16" Height="16" Margin="0,0,2,2"  ></Image>
                            <TextBlock VerticalAlignment="Center" Text="{Binding DisplayName}"   ></TextBlock>
                        </StackPanel>
                    </HierarchicalDataTemplate>
                </TreeView.ItemTemplate>
            </TreeView>
        <Separator Grid.Row="5"></Separator>
        <ProgressBar Grid.Row="6" Name="pbarBatchGenerate" Width="450" Height="26" Margin="5,0,0,0" HorizontalAlignment="Left" />
        <Button Grid.Row="6" Width="120" HorizontalAlignment="Right" Height="26" Margin="0,0,5,0" Click="btnGenerate_Click" >
            <TextBlock>Generate</TextBlock>
        </Button>
    </Grid>
</Window>
